package com.yygo.model;

import com.yygo.model.enums.MaritalStatus;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by tiansha on 2015/8/23.
 */
@Entity
@Table(name = "credit_questionnaire")
public class CreditQuestionnaire implements Serializable {

    private static final long serialVersionUID = 3020924727315890939L;
    private Long id;
    private String creditLevel;
    private float averageBillingIn6Months;

    private MaritalStatus maritalStatus;
    private String mobileNo;
    private String homeTelNo;
    private String workTelNo;
    private Address address;
    private Address hkAddress;
    private String workCompany;
    private Address workAddress;
    private String job;
    private String joinCompanyYear;
    private Date infoUpdateDatetime;

    //house
    private int unfinishedLoanCount;
    private float unfinishedLoanAmount;
    private Date latestLoanDate;
    private String overdueInfo;
    private int finishedLoanCount;
    private Date latestFinishLoanDate;
    private String overdueInfoHouse;

    //business loan
    private int unfinishedBusinessLoanCount;
    private float unfinishBusinessLoanAmount;
    private Date latestBusinessLoanDate;
    private String businessOverdueInfo;

    //car loan
    private int unfinishedCarLoanCount;
    private float unfinishedCarLoanAmount;
    private Date latestCarLoanDate;
    private float latestCarLoanAmount;
    private int finishedCarLoanCount;
    private Date latestFinishedCarLoanDate;
    private String carOverdueInfo;

    //credit card
    private int cardCount;
    private float creditAmount;
    private float averageAmountIn6Months;
    private int queryCountIn3Months;
    private String creditOverdueInfo;

    private int latest1monthQueryCount;
    private int latest2yearsQueryCount;
    private String queryDateDescription;

    private float guaranteeBalanceForOthers;
    private float yearlyDebtSpending;
    private float usedAmount;


    private boolean everCarLoaned;

    private float yearlyAffordableSpending;

    public CreditQuestionnaire() {}

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="credit_level")
    public String getCreditLevel() {
        return creditLevel;
    }

    public void setCreditLevel(String creditLevel) {
        this.creditLevel = creditLevel;
    }

    @Column(name="over_due_info")
    public String getOverdueInfo() {
        return overdueInfo;
    }

    public void setOverdueInfo(String overdueInfo) {
        this.overdueInfo = overdueInfo;
    }

    @Enumerated(EnumType.STRING)
    @Column(name = "marital_status", length = 20)
    public MaritalStatus getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(MaritalStatus maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    @Column(name="mobile_no")
    public String getMobileNo() {
        return mobileNo;
    }

    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name="address_id")
    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name="hk_address_id")
    public Address getHkAddress() {
        return hkAddress;
    }

    public void setHkAddress(Address hkAddress) {
        this.hkAddress = hkAddress;
    }

    @Column(name="work_company")
    public String getWorkCompany() {
        return workCompany;
    }

    public void setWorkCompany(String workCompany) {
        this.workCompany = workCompany;
    }

    @Column(name="unfinished_loan_count")
    public int getUnfinishedLoanCount() {
        return unfinishedLoanCount;
    }

    public void setUnfinishedLoanCount(int unfinishedLoanCount) {
        this.unfinishedLoanCount = unfinishedLoanCount;
    }

    @Column(name="unfinished_loan_amount")
    public float getUnfinishedLoanAmount() {
        return unfinishedLoanAmount;
    }

    public void setUnfinishedLoanAmount(float unfinishedLoanAmount) {
        this.unfinishedLoanAmount = unfinishedLoanAmount;
    }

    @Column(name="average_billing_in_6months")
    public float getAverageBillingIn6Months() {
        return averageBillingIn6Months;
    }

    public void setAverageBillingIn6Months(float averageBillingIn6Months) {
        this.averageBillingIn6Months = averageBillingIn6Months;
    }

    @Column(name="card_count")
    public int getCardCount() {
        return cardCount;
    }

    public void setCardCount(int cardCount) {
        this.cardCount = cardCount;
    }

    @Column(name="credit_amount")
    public float getCreditAmount() {
        return creditAmount;
    }

    public void setCreditAmount(float creditAmount) {
        this.creditAmount = creditAmount;
    }

    @Column(name="used_amount")
    public float getUsedAmount() {
        return usedAmount;
    }

    public void setUsedAmount(float usedAmount) {
        this.usedAmount = usedAmount;
    }

    @Column(name="average_amount_in_6months")
    public float getAverageAmountIn6Months() {
        return averageAmountIn6Months;
    }

    public void setAverageAmountIn6Months(float averageAmountIn6Months) {
        this.averageAmountIn6Months = averageAmountIn6Months;
    }

    @Column(name="query_count_in_3months")
    public int getQueryCountIn3Months() {
        return queryCountIn3Months;
    }

    public void setQueryCountIn3Months(int queryCountIn3Months) {
        this.queryCountIn3Months = queryCountIn3Months;
    }

    @Column(name="ever_car_loaned")
    public boolean isEverCarLoaned() {
        return everCarLoaned;
    }

    public void setEverCarLoaned(boolean everCarLoaned) {
        this.everCarLoaned = everCarLoaned;
    }

    @Column(name="yearly_debt_spending")
    public float getYearlyDebtSpending() {
        return yearlyDebtSpending;
    }

    public void setYearlyDebtSpending(float yearlyDebtSpending) {
        this.yearlyDebtSpending = yearlyDebtSpending;
    }

    @Column(name="yearly_affordable_spending")
    public float getYearlyAffordableSpending() {
        return yearlyAffordableSpending;
    }

    public void setYearlyAffordableSpending(float yearlyAffordableSpending) {
        this.yearlyAffordableSpending = yearlyAffordableSpending;
    }

    @Column(name="guarantee_balance_for_others")
    public float getGuaranteeBalanceForOthers() {
        return guaranteeBalanceForOthers;
    }

    public void setGuaranteeBalanceForOthers(float guaranteeBalanceForOthers) {
        this.guaranteeBalanceForOthers = guaranteeBalanceForOthers;
    }

    @Column(name="home_tel_no")
    public String getHomeTelNo() {
        return homeTelNo;
    }

    public void setHomeTelNo(String homeTelNo) {
        this.homeTelNo = homeTelNo;
    }
    @Column(name="work_tel_no")
    public String getWorkTelNo() {
        return workTelNo;
    }

    public void setWorkTelNo(String workTelNo) {
        this.workTelNo = workTelNo;
    }

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name="work_address_id")
    public Address getWorkAddress() {
        return workAddress;
    }

    public void setWorkAddress(Address workAddress) {
        this.workAddress = workAddress;
    }

    @Column(name="job")
    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }
    @Column(name="join_company_year")
    public String getJoinCompanyYear() {
        return joinCompanyYear;
    }

    public void setJoinCompanyYear(String joinCompanyYear) {
        this.joinCompanyYear = joinCompanyYear;
    }
    @Column(name="info_update_datetime")
    public Date getInfoUpdateDatetime() {
        return infoUpdateDatetime;
    }

    public void setInfoUpdateDatetime(Date infoUpdateDatetime) {
        this.infoUpdateDatetime = infoUpdateDatetime;
    }
    @Column(name="latest_loan_date")
    public Date getLatestLoanDate() {
        return latestLoanDate;
    }

    public void setLatestLoanDate(Date latestLoanDate) {
        this.latestLoanDate = latestLoanDate;
    }
    @Column(name="finished_loan_count")
    public int getFinishedLoanCount() {
        return finishedLoanCount;
    }

    public void setFinishedLoanCount(int finishedLoanCount) {
        this.finishedLoanCount = finishedLoanCount;
    }
    @Column(name="latest_finish_loan_date")
    public Date getLatestFinishLoanDate() {
        return latestFinishLoanDate;
    }

    public void setLatestFinishLoanDate(Date latestFinishLoanDate) {
        this.latestFinishLoanDate = latestFinishLoanDate;
    }
    @Column(name="overdue_info_house")
    public String getOverdueInfoHouse() {
        return overdueInfoHouse;
    }

    public void setOverdueInfoHouse(String overdueInfoHouse) {
        this.overdueInfoHouse = overdueInfoHouse;
    }
    @Column(name="unfinished_b_loan_count")
    public int getUnfinishedBusinessLoanCount() {
        return unfinishedBusinessLoanCount;
    }

    public void setUnfinishedBusinessLoanCount(int unfinishedBusinessLoanCount) {
        this.unfinishedBusinessLoanCount = unfinishedBusinessLoanCount;
    }
    @Column(name="unfinished_b_loan_amount")
    public float getUnfinishBusinessLoanAmount() {
        return unfinishBusinessLoanAmount;
    }

    public void setUnfinishBusinessLoanAmount(float unfinishBusinessLoanAmount) {
        this.unfinishBusinessLoanAmount = unfinishBusinessLoanAmount;
    }
    @Column(name="latest_b_loan_date")
    public Date getLatestBusinessLoanDate() {
        return latestBusinessLoanDate;
    }

    public void setLatestBusinessLoanDate(Date latestBusinessLoanDate) {
        this.latestBusinessLoanDate = latestBusinessLoanDate;
    }
    @Column(name="b_overdue_info")
    public String getBusinessOverdueInfo() {
        return businessOverdueInfo;
    }

    public void setBusinessOverdueInfo(String businessOverdueInfo) {
        this.businessOverdueInfo = businessOverdueInfo;
    }
    @Column(name = "unfinished_car_loan_count")
    public int getUnfinishedCarLoanCount() {
        return unfinishedCarLoanCount;
    }

    public void setUnfinishedCarLoanCount(int unfinishedCarLoanCount) {
        this.unfinishedCarLoanCount = unfinishedCarLoanCount;
    }
    @Column(name = "unfinished_car_loan_amount")
    public float getUnfinishedCarLoanAmount() {
        return unfinishedCarLoanAmount;
    }

    public void setUnfinishedCarLoanAmount(float unfinishedCarLoanAmount) {
        this.unfinishedCarLoanAmount = unfinishedCarLoanAmount;
    }
    @Column(name="latest_car_loan_date")
    public Date getLatestCarLoanDate() {
        return latestCarLoanDate;
    }

    public void setLatestCarLoanDate(Date latestCarLoanDate) {
        this.latestCarLoanDate = latestCarLoanDate;
    }
    @Column(name="latest_car_loan_amount")
    public float getLatestCarLoanAmount() {
        return latestCarLoanAmount;
    }

    public void setLatestCarLoanAmount(float latestCarLoanAmount) {
        this.latestCarLoanAmount = latestCarLoanAmount;
    }
    @Column(name = "finished_car_loan_count")
    public int getFinishedCarLoanCount() {
        return finishedCarLoanCount;
    }

    public void setFinishedCarLoanCount(int finishedCarLoanCount) {
        this.finishedCarLoanCount = finishedCarLoanCount;
    }
    @Column(name="latest_finished_car_loan_date")
    public Date getLatestFinishedCarLoanDate() {
        return latestFinishedCarLoanDate;
    }

    public void setLatestFinishedCarLoanDate(Date latestFinishedCarLoanDate) {
        this.latestFinishedCarLoanDate = latestFinishedCarLoanDate;
    }
    @Column(name="car_overdue_info")
    public String getCarOverdueInfo() {
        return carOverdueInfo;
    }

    public void setCarOverdueInfo(String carOverdueInfo) {
        this.carOverdueInfo = carOverdueInfo;
    }
    @Column(name="credit_overdue_info")
    public String getCreditOverdueInfo() {
        return creditOverdueInfo;
    }

    public void setCreditOverdueInfo(String creditOverdueInfo) {
        this.creditOverdueInfo = creditOverdueInfo;
    }
    @Column(name = "latest1month_query_count")
    public int getLatest1monthQueryCount() {
        return latest1monthQueryCount;
    }

    public void setLatest1monthQueryCount(int latest1monthQueryCount) {
        this.latest1monthQueryCount = latest1monthQueryCount;
    }
    @Column(name = "latest2years_query_count")
    public int getLatest2yearsQueryCount() {
        return latest2yearsQueryCount;
    }

    public void setLatest2yearsQueryCount(int latest2yearsQueryCount) {
        this.latest2yearsQueryCount = latest2yearsQueryCount;
    }
    @Column(name="query_date_description")
    public String getQueryDateDescription() {
        return queryDateDescription;
    }

    public void setQueryDateDescription(String queryDateDescription) {
        this.queryDateDescription = queryDateDescription;
    }
}
